package com.example.play.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
import androidx.viewpager2.adapter.FragmentStateAdapter

class PlayPageAdapter constructor(private val fragments: MutableList<Fragment>,fm :FragmentManager,lifecycle: Lifecycle):FragmentStateAdapter(fm,lifecycle) {

    override fun getItemCount(): Int  = fragments.size

    override fun createFragment(position: Int): Fragment = fragments[position]

    override fun getItemId(position: Int): Long = position.toLong()
}